#include "stdafx.h"
#include "Frame.h"
#include <exception>

rh::Frame::Frame(void) : _texture(nullptr), _displayArea(sf::IntRect())
{
}

rh::Frame::Frame(sf::Texture* texture, sf::IntRect displayArea) : _displaySprite(*texture, displayArea)
{
}


rh::Frame::~Frame(void)
{
}


void rh::Frame::Draw(sf::RenderWindow& renderWindow, const sf::RenderStates & renderState)
{
	if(_isVisible)
		renderWindow.draw(_displaySprite, renderState);
}

inline void rh::Frame::Update(const sf::Time& elapsedTime,const sf::Time& totalElapsedTime)
{
}

inline void rh::Frame::setPosition(const sf::Vector2f &position) { _displaySprite.setPosition(position); }
inline void rh::Frame::setScale(const sf::Vector2f &scale) { _displaySprite.setScale(scale); }
inline void rh::Frame::setRotation(float rotation) { _displaySprite.setRotation(rotation); }
inline void rh::Frame::setDepth(float zDepth) { _zDepth = zDepth; }
inline void rh::Frame::setColor(sf::Color color) { _displaySprite.setColor(color); }
inline void rh::Frame::setVisibility(bool isVisible) { _isVisible = isVisible; }

inline const sf::Vector2f rh::Frame::getPosition() { return _displaySprite.getPosition(); };
inline const sf::Vector2f rh::Frame::getScale() { return _displaySprite.getScale(); };
inline const float rh::Frame::getRotation() { return _displaySprite.getRotation(); };
inline const sf::Color rh::Frame::getColor() { return _displaySprite.getColor(); };